#include "gtest/gtest.h"

#include "queue.h"

using namespace algo;


TEST(EnqueueTest, HandlesAdd)
{
	Queue<int> queue;
	queue.enqueue(123);
    EXPECT_EQ(queue.size(), 1);
}

TEST(EnqueueTest2, HandlesAdd)
{
	Queue<int> queue;
	queue.enqueue(123);
	int val = 0;
	bool ret = queue.dequeue(val);
    EXPECT_EQ(queue.size(), 0);
}

TEST(EnqueueTest3, HandlesAdd)
{
	Queue<int> queue;
	queue.enqueue(123);
	int val = 0;
	bool ret = queue.dequeue(val);
    EXPECT_EQ(val, 123);
}

TEST(EnqueueTest4, HandlesAdd)
{
	Queue<int> queue;
	queue.enqueue(123);
	queue.enqueue(234);
	int val = 0;
	bool ret = queue.dequeue(val);
    EXPECT_EQ(val, 123);
}

TEST(EnqueueTest5, HandlesAdd)
{
	Queue<int> queue;
	queue.enqueue(123);
	queue.enqueue(234);
	int val = 0;
	bool ret = queue.dequeue(val);
	ret = queue.dequeue(val);
    EXPECT_EQ(val, 234);
}


TEST(EnqueueTest6, HandlesAdd)
{
	Queue<int> queue;
	queue.enqueue(123);
	queue.enqueue(234);
	int val = 0;
	bool ret = queue.dequeue(val);
	ret = queue.dequeue(val);
    EXPECT_EQ(queue.size(), 0);
}

int main(int argc, char **argv)
{
	::testing::InitGoogleTest(&argc, argv);
	return RUN_ALL_TESTS();
}